<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>Document</title>
    </head>
    <body>
        <script src="./zqd.js"></script>
        <script src="./jquery/jquery.min.js"></script>

        <script>
            // console.log($);
            // console.log(jQuery);
            // $.sayHi()

            // JQ交出对$的控制权
            // $.noConflict();
            // console.log($);//{张全蛋}
            // console.log(jQuery);//k.fn.init...

            // remove all 交出$和jQuery的控制权
            // $.noConflict(true);
            // console.log($);//{name: "张全蛋", age: 18, sayHi: ƒ}
            // console.log(jQuery);//{name: "张全蛋", age: 18, sayHi: ƒ}

            const jq = $.noConflict(true);
            console.log($);//{name: "张全蛋", age: 18, sayHi: ƒ}
            console.log(jQuery);//{name: "张全蛋", age: 18, sayHi: ƒ}
            console.log(jq);//k.fn.init...

            // 以jq代替原来的$或jQuery
            jq.get(
                //url
                "./ajax/server/ajaxGet.php",

                //数据
                { a: 200, b: 300 },

                // 成功回调
                function (data, status, xhr) {
                    console.log(data);
                    console.log(status, xhr);
                },

                // text 结果当做字符串解析
                // json 结果当做json解析 解析的结果是 js数据
                "text"
            );
        </script>
    </body>
</html>
